const api = require('./api.js');

//微信授权
export const wxLogin = (params) => api.post('app.php?m=App&c=Mine&a=wx_login', params);
//首页
export const index = (params) => api.get('app.php?m=App&c=Index&a=index', params);
//会员数量
export const membe = (params) => api.get('app.php?m=App&c=index&a=membe', params);
//新闻列表
export const newsList = (params) => api.get('app.php?m=App&c=Index&a=news', params);
//新闻详情
export const newsapi = (params) => api.get('app.php?m=App&c=Index&a=news_api', params);
//找材料
export const product = (params) => api.get('app.php?m=App&c=Item&a=index', params);
//热门搜索
export const hotKeyWord = (params) => api.get('app.php?m=App&c=item&a=keyword', params);
//搜索
export const search = (params) => api.get('app.php?m=App&c=Item&a=search', params);
//商品详情
export const detail = (params) => api.get('app.php?m=App&c=Item&a=detail', params);
//商品多规格多属性
export const detailTwo = (params) => api.get('app.php?m=App&c=Item&a=detail_two', params);
//去结算
export const cartplace = (params) => api.post('app.php?m=App&c=Shopping&a=index', params);
//提交订单
export const submitGet = (params) => api.post('app.php?m=App&c=shopping&a=submit', params);
//微信支付
export const weChatPay = (params) => api.post('app.php?m=App&c=shopping&a=process_Wx_pay', params);
//货到付款
export const payDelivery = (params) => api.post('app.php?m=App&c=shopping&a=pay', params);

//个人中心
export const mineIndex = (params) => api.post('app.php?m=App&c=Mine&a=index', params);
//常见问题列表
export const question = (params) => api.post('app.php?m=App&c=Mine&a=question', params);
//常见问题详情
export const questionApi = (params) => api.post('app.php?m=App&c=index&a=question_api', params);
//会员权益
export const vipApi = (params) => api.post('app.php?m=App&c=index&a=vip_api', params);
//修改真实姓名
export const setName = (params) => api.post('app.php?m=App&c=Mine&a=set_name', params);
//绑定手机号
export const bindMobile = (params) => api.post('app.php?m=App&c=Mine&a=binding', params);
//获取验证码
export const getCode = (params) => api.post('app.php?m=App&c=Mine&a=getcode', params);
//收货地址列表
export const getAddress = (params) => api.get('app.php?m=App&c=Mine&a=address', params);
//新增收货地址
export const addAddress = (params) => api.post('app.php?m=App&c=Mine&a=add_address', params);
//显示收货地址
export const lookAddress = (params) => api.post('app.php?m=App&c=Mine&a=sedit_address', params);
//修改收货地址
export const editAddress = (params) => api.post('app.php?m=App&c=Mine&a=edit_address', params);
//删除收货地址
export const delAddress = (params) => api.get('app.php?m=App&c=Mine&a=del_address', params);
//设为默认地址
export const defAddress = (params) => api.get('app.php?m=App&c=Mine&a=mo_address', params);

//我的订单
export const orderMy = [
  (params) => api.post('app.php?m=App&c=order&a=index', params),  //所有订单
  (params) => api.post('app.php?m=App&c=order&a=wait_pay', params),  //待付款订单
  (params) => api.post('app.php?m=App&c=order&a=wait_sent', params),  //待发货订单
  (params) => api.post('app.php?m=App&c=order&a=wait_get', params),  //待收货订单
  // (params) => api.post('app.php?m=App&c=order&a=wait_comment', params),  //已经完成订单
  (params) => api.post('app.php?m=App&c=order&a=complete', params)  //待评价订单
];
//删除或取消订单 ==>操作类型1为取消订单，2为删除订单
export const delOrder = (params) => api.get('app.php?m=App&c=order&a=del_order', params);
//订单详情
export const readOrder = (params) => api.get('app.php?m=App&c=order&a=read_order', params);
//确认收货
export const gettedOrder = (params) => api.get('app.php?m=App&c=order&a=getted', params);
//申请退货
export const orderOut = (params) => api.post('app.php?m=App&c=order&a=out', params);